<template>
  <scroll-view simple>
    <div style="padding: 5px 10px">
      <table style="width:100%" class="order-table" v-loading="chat.orderLoading">
        <thead>
          <tr>
            <th>商品名称</th>
            <th>下单时间</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <tr v-for="(it, i) in orderList" :key="i">
            <td style="width: 33%">{{it.orderGoodsName}}</td>
            <td>{{new Date(it.orderCreateTime).toLocaleDateString() + new Date(it.orderCreateTime).toLocaleTimeString()}}</td>
            <td><el-link type="primary" style="font-size:12px;" @click="chat.onClickTakeOrder(it['orderId'])">接单</el-link></td>
          </tr>
        </tbody>
      </table>
    </div>
  </scroll-view>
</template>
<script>
export default {
  inject: ['chat'],
  data () {
    return {
      key: 0
    }
  },
  computed: {
    orderList () {
      return this.chat.orders
    }
  },
  methods: {},
  watch: {}
}
</script>

<style scoped lang="scss">
.order-table {
  th {
    font-size: 14px;
    padding: 8px 0;
    border-bottom: 1px solid #ebeef5;
    font-weight: normal;
  }
  td {
    padding: 10px 0;
    font-size: 12px;
    text-align: center;
    color: #606266;
    border-bottom: 1px solid #ebeef5;
  }
}
</style>
